<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/','\App\Http\Controllers\Client\IndexController@index');
Route::get('/index','\App\Http\Controllers\IndexController@index');
Route::get('/test',function (){
    return view('test.test');
});
Route::group(['namespace' => 'Client','prefix'=>'client'],function (){
    Route::get('/index','IndexController@index');
    Route::get('/view/{id}','IndexController@view');
    Route::group(['prefix'=>'comment'],function (){
       Route::post('/add','CommentController@add');
    });
});

Route::group(['namespace' => 'Admin','prefix'=>'admin'],function (){
   Route::get('/index','IndexController@index');

   Route::post('/upload','FileController@upload');

   Route::group(['prefix'=>'page'],function (){
       Route::get('/index','PageController@index');
       Route::match(['get','post'],'/add/{type?}','PageController@add');
   });

    Route::group(['prefix'=>'category'],function (){
        Route::get('/index/{type?}','CategoryController@index');
        Route::post('/save','CategoryController@save');
        Route::post('/remove','CategoryController@remove');
        Route::post('/search','CategoryController@search');
        Route::post('/import','CategoryController@import');
    });
});